package io.github.jesse205.dragdrop.pro.ui.contents

import android.os.Bundle
import android.view.MenuItem
import io.github.jesse205.dragdrop.pro.app.BaseActivity
import io.github.jesse205.dragdrop.pro.databinding.ActivityContentsBinding
import io.github.jesse205.dragdrop.pro.extensions.fixSystemBars
import io.github.jesse205.dragdrop.pro.extensions.setupToolbar

class ContentsActivity : BaseActivity() {

    private val binding: ActivityContentsBinding by lazy {
        ActivityContentsBinding.inflate(layoutInflater)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        fixSystemBars(statusBarContrast = false, navigationBarContrast = true)
        setContentView(binding.root)
        setupToolbar(binding.toolbar, true)
    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        when (item.itemId) {
            android.R.id.home -> finish()
            else -> return super.onOptionsItemSelected(item)
        }
        return true
    }
}